import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooJobsController } from '../../../controllers';
const uctoojobsRouter = new Router();
const jobsController = new uctooJobsController();

uctoojobsRouter.post('/add', requireUser, jobsController.add);
uctoojobsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/jobs'), jobsController.edit);
uctoojobsRouter.post('/del', requireUser, rowLevelPermission('uctoo/jobs'), jobsController.delete);

//For getting jobs with permission control
uctoojobsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/jobs'), jobsController.getSingle);
uctoojobsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/jobs'), jobsController.getMany);
uctoojobsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/jobs'), jobsController.getMany);

//#endregion AutoCreateCode
export default uctoojobsRouter;
